$(function() {
	$(document).ready(function() {
		var part={
				interfaceAddress:"222.178.231.82",
				interfacePort:"1"
		}
		CreateTV(part,0,true);
	});
	function CreateTV(part,interval,isInstall)
	{
		var isIECore='';
		if(!!window.ActiveXObject || "ActiveXObject" in window)
		    isIECore=true;
		else  
		    isIECore=false;
		
		if (isIECore) {
			if(isInstall){
				WatchTV(part.interfaceAddress,part.interfacePort); 
			}
		}
		else {
			$('#csocx').remove();
			setTimeout(function(){
				$('#realTimeTV').append('<object id="csocx" clsid="{59EA8A50-4FC1-406a-A471-595247AB2E41}" type="application/x-itst-activex"  progid="/wcsi/tvfile/CISDITV.cab" width="100%" height="415px"></object>');
				WatchTV(part.interfaceAddress,part.interfacePort);	
			},interval);
		}
	};
	function WatchTV(ip,channel)
	{
		var ocxKq = document.getElementById("csocx");
		ocxKq.InstallView(ip,channel); 
		ocxKq.OpenStream();
	};
});
